package com.qf.chinatelcom.apiinterface.mq.listeners;

import com.qf.chinatelcom.apiinterface.service.PushReportService;
import com.qianfeng.smsplatform.common.constants.RabbitMqConsants;
import com.qianfeng.smsplatform.common.model.Standard_Report;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Component;

@Component
public class ReportListener {

    private PushReportService pushReportService;

    @Autowired
    public void setPushReportService(PushReportService pushReportService) {
        this.pushReportService = pushReportService;
    }
    @RabbitListener(queues = RabbitMqConsants.TOPIC_PUSH_SMS_REPORT)
    @Async
    public void onMessage(Standard_Report report) {
        //给用户反馈信息
        pushReportService.pushReport(report);
    }
}
